<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>媒体查询</title> 
<style>
body {
    background-color: pink;
    color: #fff;
}
ul {
    list-style-type: none;
}

ul li a {
    color: green;
    text-decoration: none;
    padding: 3px; 
    display: block;
}
/*大屏幕*/
@media screen and (min-width: 1200px) {
    body {
        background-color: brown;
    }
}
/*平板电脑与小屏电脑之间的分辨率*/
@media screen and (min-width: 768px) and (max-width:979px) {
    body {
        background-color: blue;
    }
}
/*横向放置的手机和竖向放置的平板之间的分辨率*/
@media screen and (max-width:767px) {
    body {
        background-color: blueviolet;
    }
}

/*竖向放置的手机以及分别率*/
@media screen and (max-width: 480px) {
    body {
        background-color: black;
    }
}
</style>
</head>
<body>

<h1 >重置浏览器窗口查看效果！</h1>
<p>超大屏幕 (min-width: 1200px)   红色</p>
<p>正常屏幕 (min-width:980px)and(max-width: 1200px)   粉色</p>
<p>平板电脑与小屏电脑之间的分辨率(min-width: 768px) and (max-width:979px)  蓝色</p>
<p>横向放置的手机和竖向放置的平板之间的分辨率(max-width:767px)   紫色;</p>
<p>竖向放置的手机以及更小分别率 黑色</p>

<p id="docWidth"></p>
</body>
</html>

<script type="text/javascript">
	window.onresize = function() {
		document.getElementById('docWidth').innerText = document.documentElement.clientWidth;
	}
</script>